import 'package:json_annotation/json_annotation.dart';

part 'economic_model.g.dart';

@JsonSerializable(explicitToJson: true)
class EconomicModel {
  EconomicModel(this.pagecount, this.pagecurrent, this.result);

  final int pagecount;
  final int pagecurrent;
  final List<NationData> result;

  factory EconomicModel.fromJson(Map<String, dynamic> json) =>
      _$EconomicModelFromJson(json);

  Map<String, dynamic> toJson() => _$EconomicModelToJson(this);
}

@JsonSerializable()
class NationData {
  NationData(this.data, this.db, this.exp, this.prank, this.rank, this.reg,
      this.report, this.sj, this.zb);

  // 值
  final String data;

  // 分类
  final String db;

  // 备注
  final String exp;
  final double prank;
  final double rank;

  // 区域
  final String reg;

  // 相关报表
  final String report;

  // 时间
  final String sj;

  // 名称
  final String zb;

  factory NationData.fromJson(Map<String, dynamic> json) =>
      _$GDPDataFromJson(json);

  Map<String, dynamic> toJson() => _$GDPDataToJson(this);
}
